#include "XFtpSessionFactory.h"
#include "XFtpSession.h"
#include "XFtpUSER.h"
#include "XFtpPWD.h"
#include "XFtpPORT.h"
#include "XFtpLIST.h"
#include "XFtpCWD.h"
#include "XFtpCDUP.h"
#include "XFtpRETR.h"
#include "XFtpSTOR.h"

XFtpSessionFactory::XFtpSessionFactory()
{
}


XFtpSessionFactory::~XFtpSessionFactory()
{
}

XTask * XFtpSessionFactory::createTask(evutil_socket_t fd)
{
    XFtpSession *task = new XFtpSession(fd);

    task->registerCommand("USER", new XFtpUSER);
    task->registerCommand("PWD", new XFtpPWD);
    task->registerCommand("PORT", new XFtpPORT);
    task->registerCommand("LIST", new XFtpLIST);
    task->registerCommand("CWD", new XFtpCWD);
    task->registerCommand("CDUP", new XFtpCDUP);
    task->registerCommand("RETR", new XFtpRETR);
    task->registerCommand("STOR", new XFtpSTOR);
    return task;
}
